home *** CD-ROM | disk | FTP | other *** search
/ Corel Professional Photo…87: Reptiles & Amphibians / Corel Professional Photos - 1994 - 087 - Reptiles and Amphibians.ISO / utils / setup / corelcd.mst < prev    next >
Text File  |  1993-09-07  |  23KB  |  770 lines

  1. '**************************************************************************
  2. '*           MSSetup Toolkit - Corel Professional Photos Setup            *
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. CONST WS_VISIBLE=&H10000000
  11. CONST WS_BORDER =&H00800000
  12. CONST WS_CLIPCHILDREN =&H02000000
  13. CONST GWL_STYLE =-16
  14. CONST SW_SHOWMAXIMIZED=3
  15.  
  16. DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  17. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%,offset%,style&) AS LONG
  18.  
  19. hWnd%=HwndFrame()
  20.  
  21. sti&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  22. stj%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
  23.  
  24. ''Dialog ID's
  25. CONST WELCOME      = 100
  26. CONST ASKQUIT      = 200
  27. CONST DESTPATH     = 300
  28. CONST EXITFAILURE  = 400
  29. CONST EXITQUIT     = 600
  30. CONST EXITSUCCESS  = 700
  31. CONST APPHELP      = 900
  32. CONST CUSTINST     = 6200
  33. CONST TOOBIG       = 6300
  34. CONST BADPATH      = 6400
  35. CONST MOSAIC       = 7100
  36. CONST PCDSCSI      = 7200
  37. CONST CDAUDIO      = 7300
  38.  
  39. ''Bitmap ID
  40. CONST LOGO         = 1
  41.  
  42. ''File Types
  43. CONST PCDLABFILES    = 1
  44. CONST PCDMOSFILES    = 2
  45. CONST PCDAUDFILES    = 3
  46. CONST PCDSCRFILES    = 4
  47. CONST PCDWALFILES    = 5
  48.  
  49. FLAG1$          ="No"      '' Copy flags for
  50. FLAG2$          ="No"      '' DLL files that go
  51. FLAG3$          ="No"      '' into WindowsDir and WindowsSysDir
  52.  
  53.  
  54. GLOBAL DEST$        ''Default destination directory.
  55. GLOBAL WINDRIVE$    ''Windows drive letter.
  56. GLOBAL OPT1OPT$     ''Option selection from OptFiles1 option dialog.
  57. GLOBAL OPT2OPT$     ''Option selection from OptFiles2 option dialog.
  58. GLOBAL OPT3OPT$     ''Option selection from OptFiles3 option dialog.
  59. GLOBAL OPT4OPT$     ''Option selection from OptFiles4 option dialog.
  60. GLOBAL MosDir$      ''Location of old mosaic program, if found.
  61.  
  62. ''CustInst list symbol names
  63. GLOBAL PCDLABNEEDS$    ''Option list costs per drive
  64. GLOBAL PCDMOSNEEDS$
  65. GLOBAL PCDAUDNEEDS$
  66. GLOBAL PCDSCRNEEDS$
  67. GLOBAL PCDWALNEEDS$
  68.  
  69. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  70. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  71.  
  72. ''Dialog list symbol names
  73. GLOBAL CHECKSTATES$
  74. GLOBAL STATUSTEXT$
  75. GLOBAL DRIVETEXT$
  76.  
  77.  
  78. DECLARE SUB AddOptFilesToCopyList (ftype%)
  79. DECLARE SUB RecalcOptFiles (ftype%)
  80. DECLARE SUB RecalcPath
  81. DECLARE SUB SetDriveStatus
  82. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  83.  
  84.  
  85.  
  86. INIT:
  87.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  88.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  89.  
  90.     SetBitmap CUIDLL$, LOGO
  91.     SetTitle "Corel Professional Photos Setup"
  92.  
  93.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  94.     IF szInf$ = "" THEN
  95.     szInf$ = GetSymbolValue("STF_CWDDIR") + "CORELCD.INF"
  96.     END IF
  97.     ReadInfFile szInf$
  98.  
  99.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  100.     WINDIR$ = GetWindowsDir()
  101.     DEST$ = WINDRIVE$ + ":\CORELCD"
  102.  
  103.     ''CustInst list symbols
  104.     CHECKSTATES$ = "CheckItemsState"
  105.     STATUSTEXT$  = "StatusItemsText"
  106.     DRIVETEXT$   = "DriveStatusText"
  107.     FOR i% = 1 TO 8 STEP 1
  108.     AddListItem CHECKSTATES$, "ON"
  109.     NEXT i%
  110.     FOR i% = 1 TO 8 STEP 1
  111.     AddListItem STATUSTEXT$, ""
  112.     NEXT i%
  113.     FOR i% = 1 TO 7 STEP 1
  114.     AddListItem DRIVETEXT$, ""
  115.     NEXT i%
  116.     ReplaceListItem DRIVETEXT$, 7, DEST$
  117.  
  118.     ''Disk cost list symbols
  119.     PCDLABNEEDS$  = "PcdLabNeeds"
  120.     PCDMOSNEEDS$  = "PcdMosNeeds"
  121.     PCDAUDNEEDS$  = "PcdAudNeeds"
  122.     PCDSCRNEEDS$  = "PcdScrNeeds"
  123.     PCDWALNEEDS$  = "PcdWalNeeds"
  124.     EXTRACOSTS$ = "ExtraCosts"
  125.     BIGLIST$    = "BigList"
  126.     FOR i% = 1 TO 5 STEP 1
  127.     AddListItem BIGLIST$, ""
  128.     NEXT i%
  129.     FOR i% = 1 TO 26 STEP 1
  130.     AddListItem EXTRACOSTS$, "0"
  131.     NEXT i%
  132.  
  133.     ''File Option Variables
  134.     OPT1OPT$ = "1"
  135.     OPT2OPT$ = "1"
  136.     OPT3OPT$ = "1"
  137.     OPT4OPT$ = "1"
  138.  
  139.     RecalcPath
  140.     SetDriveStatus
  141.  
  142. '$IFDEF DEBUG
  143.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  144. '$ENDIF ''DEBUG
  145.  
  146.  
  147. WELCOME:
  148.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  149.     IF sz$ = "CONTINUE" THEN
  150.     UIPop 1
  151.     ELSE
  152.     GOSUB ASKQUIT
  153.     GOTO WELCOME
  154.     END IF
  155.  
  156.  
  157. CUSTINST:
  158.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  159.  
  160.     IF sz$ = "CONTINUE" THEN
  161.     ''Install only if it will fit.
  162.     FOR i% = 1 TO 5 STEP 1
  163.         IF GetListItem(BIGLIST$, i%) <> "" THEN
  164.         GOSUB TOOBIG
  165.         GOTO CUSTINST
  166.         END IF
  167.     NEXT i%
  168.     UIPop 1
  169.     GOTO INSTALL
  170.     ELSEIF sz$ = "PATH" THEN
  171.     GOTO GETPATH
  172.     ELSEIF sz$ = "CHK1" THEN
  173.     RecalcOptFiles PCDLABFILES
  174.     SetDriveStatus
  175.     GOTO CUSTINST
  176.     ELSEIF sz$ = "CHK2" THEN
  177.     RecalcOptFiles PCDMOSFILES
  178.     SetDriveStatus
  179.     GOTO CUSTINST
  180.     ELSEIF sz$ = "CHK3" THEN
  181.     RecalcOptFiles PCDAUDFILES
  182.     SetDriveStatus
  183.     GOTO CUSTINST
  184.     ELSEIF sz$ = "CHK4" THEN
  185.     RecalcOptFiles PCDSCRFILES
  186.     SetDriveStatus
  187.     GOTO CUSTINST
  188.     ELSEIF sz$ = "CHK5" THEN
  189.     RecalcOptFiles PCDWALFILES
  190.     SetDriveStatus
  191.     GOTO CUSTINST
  192.     ELSEIF sz$ = "BTN2" THEN
  193.     GOTO PCDMOSFILES
  194.     ELSEIF sz$ = "BTN3" THEN
  195.     GOTO PCDAUDFILES
  196.     ELSEIF sz$ = "BTN4" THEN
  197.     GOTO PCDSCRFILES
  198.     ELSEIF sz$ = "BTN5" THEN
  199.     GOTO PCDWALFILES
  200.     ELSEIF sz$ = "REACTIVATE" THEN
  201.     RecalcPath
  202.     SetDriveStatus
  203.     GOTO CUSTINST
  204.     ELSE
  205.     GOSUB ASKQUIT
  206.     GOTO CUSTINST
  207.     END IF
  208.  
  209.  
  210.  
  211. INSTALL:
  212.     ClearCopyList
  213.     AddOptFilesToCopyList PCDLABFILES
  214.     AddOptFilesToCopyList PCDMOSFILES
  215.     AddOptFilesToCopyList PCDAUDFILES
  216.     AddOptFilesToCopyList PCDSCRFILES
  217.     AddOptFilesToCopyList PCDWALFILES
  218.     CreateDir DEST$, cmoNone
  219.     
  220.     IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  221.      IF DoesIniKeyExist("WIN.INI", "PhotoCD Lab", "Dir") = 1 THEN
  222.          PcdDir$ = GetIniKeyString("WIN.INI", "PhotoCD Lab", "Dir")
  223.          IF DoesFileExist(PcdDir$ + "\PCDSCSI.EXE", femReadWrite) = 1 THEN
  224.          SetSymbolValue "ConfirmTextIn", PcdDir$
  225.          SetSymbolValue "EditFocus", "END"
  226.          sz$ = UIStartDlg(CUIDLL$, PCDSCSI, "FConfirmDlgProc", APPHELP, HELPPROC$)
  227.          IF sz$ = "BACK" THEN
  228.              UIPop 1
  229.              GOTO CUSTINST
  230.          ELSEIF sz$ = "CONTINUE" THEN
  231.              UIPop 1
  232.          END IF
  233.          END IF
  234.      END IF
  235.      IF PcdDir$ <> "" THEN
  236.          CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", PcdDir$, cmoOverwrite
  237.      ELSE
  238.          CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", DEST$ + "\PCDLAB", cmoOverwrite
  239.      END IF
  240.     END IF
  241.  
  242.      IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
  243.      IF MosDir$ <> "" THEN
  244.          SetSymbolValue "ConfirmTextIn", MosDir$
  245.          SetSymbolValue "EditFocus", "END"
  246.          sz$ = UIStartDlg(CUIDLL$, MOSAIC, "FConfirmDlgProc", APPHELP, HELPPROC$)
  247.          IF sz$ = "BACK" THEN
  248.              UIPop 1
  249.              GOTO CUSTINST
  250.          ELSEIF sz$ = "CONTINUE" THEN
  251.              UIPop 1
  252.          END IF
  253.      END IF    
  254.      IF MosDir$ = "" THEN    
  255.          CreateIniKeyValue "WIN.INI", "CorelGraphics4", "Dir", DEST$ + "\MOSAIC\CONFIG", cmoOverwrite
  256.          CreateDir DEST$ + "\MOSAIC\CONFIG", cmoNone
  257.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "ProgramsDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  258.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "CustomDir", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  259.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "MosaicDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  260.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "FiltersDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  261.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "DataDir", DEST$ + "\MOSAIC\PROGRAMS\DATA", cmoOverwrite
  262.      END IF
  263.      END IF
  264.     
  265.     IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
  266.      IF DoesIniKeyExist("WIN.INI", "CorelSCSI", "CD-Audio") = 1 THEN
  267.          CDAudioDir$ = GetIniKeyString("WIN.INI", "CorelSCSI", "CD-Audio")
  268.          IF DoesFileExist(CDAudioDir$ + "\CD_AUDIO.EXE", femReadWrite) = 1 THEN
  269.          SetSymbolValue "ConfirmTextIn", CDAudioDir$
  270.          SetSymbolValue "EditFocus", "END"
  271.          sz$ = UIStartDlg(CUIDLL$, CDAUDIO, "FConfirmDlgProc", APPHELP, HELPPROC$)
  272.          IF sz$ = "BACK" THEN
  273.              UIPop 1
  274.              GOTO CUSTINST
  275.          ELSEIF sz$ = "CONTINUE" THEN
  276.              UIPop 1
  277.          END IF
  278.          END IF
  279.      END IF
  280.      CreateIniKeyValue "WIN.INI", "CorelSCSI", "CD-Audio", DEST$ + "\PCDAUDIO", cmoOverwrite
  281.     END IF
  282.  
  283.     
  284.     CopyFilesInCopyList
  285.  
  286.     InstDrive$=MID$(DEST$,1,2)
  287.     IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  288.     CreateProgmanGroup "Corel CD-ROM Utilities", "", cmoNone
  289.     ShowProgmanGroup  "Corel Cd-ROM Utilities", 1, cmoNone
  290.     CreateProgmanItem "Corel CD-ROM Utilities", "PhotoCD Lab", MakePath(DEST$, "pcdlab\pcdscsi.exe "), "", cmoOverwrite
  291.     END IF
  292.  
  293.     IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
  294.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  295.     IF MosDir$ <> "" THEN
  296.         CreateProgmanItem "Corel CD-ROM Utilities", "CorelMOSAIC!", MosDir$ + "\CORELMOS.EXE", "", cmoOverwrite
  297.     ELSE
  298.         CreateProgmanItem "Corel CD-ROM Utilities", "CorelMOSAIC!", MakePath(DEST$, "mosaic\programs\corelmos.exe "), "", cmoOverwrite
  299.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  300.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CurvePath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  301.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELPRN.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  302.     END IF
  303.     END IF
  304.  
  305.     IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
  306.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  307.     CreateProgmanItem "Corel CD-ROM Utilities", "CD Audio", MakePath(DEST$, "pcdaudio\cd_audio.exe "), "", cmoOverwrite
  308.     END IF
  309.  
  310.     IF GetListItem(CHECKSTATES$, PCDSCRFILES) = "ON" THEN
  311.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  312.     END IF
  313.  
  314.     IF GetListItem(CHECKSTATES$, PCDWALFILES) = "ON" THEN
  315.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  316.     CreateProgmanItem "Corel CD-ROM Utilities", "Wallpaper Flipper Configuration", MakePath(GetWindowsDir, "wflipcnf.exe"), "", cmoOverwrite
  317.     END IF
  318.  
  319.     CreateProgmanItem "Corel CD-ROM Utilities", "Professional Photos ReadMe", "notepad.exe "+MakePath(DEST$,"readme.txt"), "", cmoOverwrite 
  320.  
  321. QUIT:
  322.     ON ERROR GOTO ERRQUIT
  323.  
  324.     IF ERR = 0 THEN
  325.     dlg% = EXITSUCCESS
  326.     ELSEIF ERR = STFQUIT THEN
  327.     dlg% = EXITQUIT
  328.     ELSE
  329.     dlg% = EXITFAILURE
  330.     END IF
  331. QUITL1:
  332.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  333.     IF sz$ = "REACTIVATE" THEN
  334.     GOTO QUITL1
  335.     END IF
  336.     UIPop 1
  337.  
  338.     END
  339.  
  340. ERRQUIT:
  341.     i% = DoMsgBox("Setup sources were corrupted, call Corel Tech Support", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  342.     END
  343.  
  344.  
  345.  
  346. GETPATH:
  347.     SetSymbolValue "EditTextIn", DEST$
  348.     SetSymbolValue "EditFocus", "END"
  349. GETPATHL1:
  350.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  351.  
  352.     IF sz$ = "CONTINUE" THEN
  353.     olddest$ = DEST$
  354.     DEST$ = GetSymbolValue("EditTextOut")
  355.  
  356.     ''Validate new path.
  357.     IF IsDirWritable(DEST$) = 0 THEN
  358.         GOSUB BADPATH
  359.         GOTO GETPATHL1
  360.     END IF
  361.     UIPop 1
  362.  
  363.     ''Truncate display if too long.
  364.     IF LEN(DEST$) > 23 THEN
  365.         ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  366.     ELSE
  367.         ReplaceListItem DRIVETEXT$, 7, DEST$
  368.     END IF
  369.  
  370.     ''Recalc if path changed.
  371.     IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  372.         RecalcPath
  373.         SetDriveStatus
  374.     END IF
  375.  
  376.     olddest$ = ""
  377.     GOTO CUSTINST
  378.     ELSEIF sz$ = "REACTIVATE" THEN
  379.     RecalcPath
  380.     SetDriveStatus
  381.     GOTO GETPATHL1
  382.     ELSEIF sz$ = "EXIT" THEN
  383.     GOSUB ASKQUIT
  384.     GOTO GETPATHL1
  385.     ELSE
  386.     UIPop 1
  387.     GOTO CUSTINST
  388.     END IF
  389.  
  390.  
  391.  
  392. PCDMOSFILES:
  393.     SetSymbolValue "RadioDefault", OPT1OPT$
  394. OPT1L1:
  395.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  396.     newopt$ = GetSymbolValue("ButtonChecked")
  397.  
  398.     IF sz$ = "CONTINUE" THEN
  399.     UIPop 1
  400.     IF newopt$ <> OPT1OPT$ THEN
  401.         OPT1OPT$ = newopt$
  402.         RecalcOptFiles PCDMOSFILES
  403.         SetDriveStatus
  404.     END IF
  405.     newopt$ = ""
  406.     GOTO CUSTINST
  407.     ELSEIF sz$ = "REACTIVATE" THEN
  408.     RecalcPath
  409.     SetDriveStatus
  410.     GOTO OPT1L1
  411.     ELSEIF sz$ = "EXIT" THEN
  412.     GOSUB ASKQUIT
  413.     GOTO OPT1L1
  414.     ELSE
  415.     UIPop 1
  416.     newopt$ = ""
  417.     GOTO CUSTINST
  418.     END IF
  419.  
  420.  
  421.  
  422. PCDAUDFILES:
  423.     SetSymbolValue "RadioDefault", OPT2OPT$
  424. OPT2L1:
  425.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  426.     newopt$ = GetSymbolValue("ButtonChecked")
  427.  
  428.     IF sz$ = "CONTINUE" THEN
  429.     UIPop 1
  430.     IF newopt$ <> OPT2OPT$ THEN
  431.         OPT2OPT$ = newopt$
  432.         RecalcOptFiles PCDAUDFILES
  433.         SetDriveStatus
  434.     END IF
  435.     newopt$ = ""
  436.     GOTO CUSTINST
  437.     ELSEIF sz$ = "REACTIVATE" THEN
  438.     RecalcPath
  439.     SetDriveStatus
  440.     GOTO OPT2L1
  441.     ELSEIF sz$ = "EXIT" THEN
  442.     GOSUB ASKQUIT
  443.     GOTO OPT2L1
  444.     ELSE
  445.     UIPop 1
  446.     newopt$ = ""
  447.     GOTO CUSTINST
  448.     END IF
  449.  
  450.  
  451.  
  452. PCDSCRFILES:
  453.     SetSymbolValue "RadioDefault", OPT3OPT$
  454. OPT3L1:
  455.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  456.     newopt$ = GetSymbolValue("ButtonChecked")
  457.  
  458.     IF sz$ = "CONTINUE" THEN
  459.     UIPop 1
  460.     IF newopt$ <> OPT1OPT$ THEN
  461.         OPT3OPT$ = newopt$
  462.         RecalcOptFiles PCDSCRFILES
  463.         SetDriveStatus
  464.     END IF
  465.     newopt$ = ""
  466.     GOTO CUSTINST
  467.     ELSEIF sz$ = "REACTIVATE" THEN
  468.     RecalcPath
  469.     SetDriveStatus
  470.     GOTO OPT3L1
  471.     ELSEIF sz$ = "EXIT" THEN
  472.     GOSUB ASKQUIT
  473.     GOTO OPT3L1
  474.     ELSE
  475.     UIPop 1
  476.     newopt$ = ""
  477.     GOTO CUSTINST
  478.     END IF
  479.  
  480.  
  481.  
  482. PCDWALFILES:
  483.     SetSymbolValue "RadioDefault", OPT4OPT$
  484. OPT4L1:
  485.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  486.     newopt$ = GetSymbolValue("ButtonChecked")
  487.  
  488.     IF sz$ = "CONTINUE" THEN
  489.     UIPop 1
  490.     IF newopt$ <> OPT4OPT$ THEN
  491.         OPT4OPT$ = newopt$
  492.         RecalcOptFiles PCDWALFILES
  493.         SetDriveStatus
  494.     END IF
  495.     newopt$ = ""
  496.     GOTO CUSTINST
  497.     ELSEIF sz$ = "REACTIVATE" THEN
  498.     RecalcPath
  499.     SetDriveStatus
  500.     GOTO OPT4L1
  501.     ELSEIF sz$ = "EXIT" THEN
  502.     GOSUB ASKQUIT
  503.     GOTO OPT4L1
  504.     ELSE
  505.     UIPop 1
  506.     newopt$ = ""
  507.     GOTO CUSTINST
  508.     END IF
  509.  
  510.  
  511.  
  512. TOOBIG:
  513.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  514.     IF sz$ = "REACTIVATE" THEN
  515.     RecalcPath
  516.     SetDriveStatus
  517.     GOTO TOOBIG
  518.     END IF
  519.     UIPop 1
  520.     RETURN
  521.  
  522.  
  523.  
  524. BADPATH:
  525.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  526.     IF sz$ = "REACTIVATE" THEN
  527.     RecalcPath
  528.     SetDriveStatus
  529.     GOTO BADPATH
  530.     END IF
  531.     UIPop 1
  532.     RETURN
  533.  
  534.  
  535.  
  536. ASKQUIT:
  537.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  538.  
  539.     IF sz$ = "EXIT" THEN
  540.     UIPopAll
  541.     ERROR STFQUIT
  542.     ELSEIF sz$ = "REACTIVATE" THEN
  543.     GOTO ASKQUIT
  544.     ELSE
  545.     UIPop 1
  546.     END IF
  547.     RETURN
  548.  
  549.  
  550.  
  551. '**
  552. '** Purpose:
  553. '**     Adds the specified option files to the copy list.
  554. '** Arguments:
  555. '**     ftype%  - type of files to add, one of the following:
  556. '**             PCDLABFILES, PCDAUDFILES, PCDMOSFILES, PCDSCRFILES, PCDWALFILES
  557. '** Returns:
  558. '**     none.
  559. '*************************************************************************
  560. SUB AddOptFilesToCopyList (ftype%) STATIC
  561.  
  562.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  563.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  564.     WinDirLen = LEN(GetWindowsDir)-1
  565.     WinDir$ = MID$(GetWindowsDir,1,WinDirLen)
  566.     InstDrive$ = MID$(DEST$,1,2)
  567.     IF ftype% = PCDLABFILES THEN
  568.         AddSectionFilesToCopyList "PcdLabFiles", SrcDir$, DEST$ + "\PCDLAB"
  569.         FLAG1$="Yes"
  570.         FLAG2$="Yes"
  571.         FLAG3$="Yes"
  572.     ELSEIF ftype% = PCDMOSFILES THEN
  573.      IF DoesIniKeyExist("WIN.INI", "CorelGraphics4", "Dir") = 1 THEN
  574.          CorelAppDir$ = GetIniKeyString("WIN.INI", "CorelGraphics4", "Dir")
  575.          MosDir$ = GetIniKeyString(CorelAppDir$ + "\CORELAPP.INI", "Config", "MosaicDir")
  576.          IF DoesFileExist(MosDir$ + "\CORELMOS.EXE", femReadWrite) = 1 THEN
  577.            MosFlag$ = "Yes"
  578.            AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, MosDir$
  579.            AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, MosDir$
  580.          END IF 
  581.      ELSE 
  582.           AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS"
  583.           AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, DEST$ + "\MOSAIC\CUSTOM"
  584.           AddSectionFilesToCopyList "PcdMosInis", SrcDir$, DEST$ + "\MOSAIC\CONFIG"
  585.           AddSectionFilesToCopyList "PcdMosData", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS\DATA"
  586.      END IF
  587.         FLAG1$="Yes"
  588.         FLAG3$="Yes"
  589.     ELSEIF ftype% = PCDAUDFILES THEN
  590.         AddSectionFilesToCopyList "PcdAudFiles", SrcDir$, DEST$ + "\PCDAUDIO"
  591.     ELSEIF ftype% = PCDSCRFILES THEN
  592.         AddSectionFilesToCopyList "PcdScrFiles", SrcDir$, GetWindowsDir
  593.         FLAG3$="Yes"
  594.     ELSEIF ftype% = PCDWALFILES THEN
  595.         AddSectionFilesToCopyList "PcdWalFiles", SrcDir$, GetWindowsDir
  596.     END IF
  597.     IF FLAG1$="Yes" THEN
  598.         CreateIniKeyValue "WIN.INI", "Extensions", "PCD", DEST$ + "\PCDLAB\PCDSCSI.EXE ^.PCD", cmoNone
  599.         AddSectionFilesToCopyList "PcdDllFiles", SrcDir$, GetWindowsSysDir
  600.         IF DoesFileExist(GetWindowsDir + "PCDLIB.DLL", femReadWrite) =1 THEN
  601.         RemoveFile GetWindowsDir + "PCDLIB.DLL", cmoNone
  602.         END IF
  603.         IF DoesFileExist(GetWindowsDir + "PCDXTIF.DLL", femReadWrite) =1 THEN
  604.         RemoveFile GetWindowsDir + "PCDXTIF.DLL", cmoNone
  605.         END IF
  606.         IF DoesFileExist(GetWindowsDir + "PCDXEPS.DLL", femReadWrite) =1 THEN
  607.         RemoveFile GetWindowsDir + "PCDXEPS.DLL", cmoNone
  608.         END IF
  609.         IF DoesFileExist(GetWindowsDir + "PCDXPCX.DLL", femReadWrite) =1 THEN
  610.         RemoveFile GetWindowsDir + "PCDXPCX.DLL", cmoNone
  611.         END IF
  612.         IF DoesFileExist(GetWindowsDir + "PCDXBMP.DLL", femReadWrite) =1 THEN
  613.         RemoveFile GetWindowsDir + "PCDXBMP.DLL", cmoNone
  614.         END IF
  615.     END IF
  616.     IF FLAG2$="Yes" THEN
  617.         AddSectionFilesToCopyList "PcdCtlFile", SrcDir$, GetWindowsSysDir
  618.     END IF
  619.     IF FLAG3$="Yes" THEN
  620.         AddSectionFilesToCopyList "PcdDllFile", SrcDir$, GetWindowsSysDir
  621.     END IF
  622.         AddSectionFilesToCopyList "PcdReadMe", SrcDir$, DEST$
  623.     FLAG1$="No"
  624.     FLAG2$="No"
  625.     FLAG3$="No"
  626.     SrcDir$ = ""
  627.     END IF
  628. END SUB
  629.  
  630. '**
  631. '** Purpose:
  632. '**     Recalculates disk space for the given option files and sets
  633. '**     the status info symbol "StatusItemsText".
  634. '** Arguments:
  635. '**     ftype% - type of files to add, one of the following:
  636. '**             PCDLABFILES, PCDMOSFILES, PCDAUDFILES, PCDSCRFILES, PCDWALFILES
  637. '** Returns:
  638. '**     none.
  639. '*************************************************************************
  640. SUB RecalcOptFiles (ftype%) STATIC
  641.     CursorSave% = ShowWaitCursor()
  642.     ClearCopyList
  643.     AddOptFilesToCopyList ftype%
  644.  
  645.     fExtra% = 0
  646.     IF ftype% = PCDLABFILES THEN
  647.     ListSym$ = PCDLABNEEDS$
  648.        IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  649.        ''Add extra cost to Windows drive for ini/progman, etc.
  650.        ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  651.        ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  652.        fExtra% = 1
  653.        END IF
  654.     ELSEIF ftype% = PCDMOSFILES THEN
  655.     ListSym$ = PCDMOSNEEDS$
  656.     ELSEIF ftype% = PCDAUDFILES THEN
  657.     ListSym$ = PCDAUDNEEDS$
  658.     ELSEIF ftype% = PCDSCRFILES THEN
  659.     ListSym$ = PCDSCRNEEDS$
  660.     ELSEIF ftype% = PCDWALFILES THEN
  661.     ListSym$ = PCDWALNEEDS$
  662.     END IF
  663.  
  664.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  665.  
  666.     cost& = 0
  667.     FOR i% = 1 TO 26 STEP 1
  668.     cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  669.     NEXT i%
  670.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  671.  
  672.     IF StillNeed& > 0 THEN
  673.     ReplaceListItem BIGLIST$, ftype%, "YES"
  674.     ELSE
  675.     ReplaceListItem BIGLIST$, ftype%, ""
  676.     END IF
  677.  
  678. '    IF fExtra% THEN
  679. '        ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  680. '    END IF
  681.     RestoreCursor CursorSave%
  682.     ListSym$ = ""
  683. END SUB
  684.  
  685.  
  686. '**
  687. '** Purpose:
  688. '**     Recalculates disk space and sets option status info according
  689. '**     to the current destination path.
  690. '** Arguments:
  691. '**     none.
  692. '** Returns:
  693. '**     none.
  694. '*************************************************************************
  695. SUB RecalcPath STATIC
  696.  
  697.     CursorSave% = ShowWaitCursor()
  698.  
  699.     RecalcOptFiles PCDLABFILES
  700.     RecalcOptFiles PCDMOSFILES
  701.     RecalcOptFiles PCDAUDFILES
  702.     RecalcOptFiles PCDSCRFILES
  703.     RecalcOptFiles PCDWALFILES
  704.  
  705.     RestoreCursor CursorSave%
  706. END SUB
  707.  
  708.  
  709. '**
  710. '** Purpose:
  711. '**     Sets drive status info according to latest disk space calcs.
  712. '** Arguments:
  713. '**     none.
  714. '** Returns:
  715. '**     none.
  716. '*************************************************************************
  717. SUB SetDriveStatus STATIC
  718.  
  719.     drive$ = MID$(DEST$, 1, 1)
  720.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  721.     cost& = VAL(GetListItem(PCDLABNEEDS$, ndrive%)) + VAL(GetListItem(PCDMOSNEEDS$, ndrive%)) + VAL(GetListItem(PCDAUDNEEDS$, ndrive%)) + VAL(GetListItem(PCDSCRNEEDS$, ndrive%)) + VAL(GetListItem(PCDWALNEEDS$, ndrive%))
  722.     free& = GetFreeSpaceForDrive(drive$)
  723.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  724.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  725.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  726.  
  727.     IF drive$ = WINDRIVE$ THEN
  728.     ReplaceListItem DRIVETEXT$, 4, ""
  729.     ReplaceListItem DRIVETEXT$, 5, ""
  730.     ReplaceListItem DRIVETEXT$, 6, ""
  731.     ELSE
  732.     ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  733.     cost& = VAL(GetListItem(PCDLABNEEDS$, ndrive%)) + VAL(GetListItem(PCDMOSNEEDS$, ndrive%)) + VAL(GetListItem(PCDAUDNEEDS$, ndrive%)) + VAL(GetListItem(PCDSCRNEEDS$, ndrive%)) + VAL(GetListItem(PCDWALNEEDS$, ndrive%))
  734.     IF cost& = 0 THEN
  735.         ReplaceListItem DRIVETEXT$, 4, ""
  736.         ReplaceListItem DRIVETEXT$, 5, ""
  737.         ReplaceListItem DRIVETEXT$, 6, ""
  738.     ELSE
  739.         free& = GetFreeSpaceForDrive(WINDRIVE$)
  740.         ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  741.         ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  742.         ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  743.     END IF
  744.     END IF
  745. END SUB
  746.  
  747.  
  748. '**
  749. '** Purpose:
  750. '**     Appends a file name to the end of a directory path,
  751. '**     inserting a backslash character as needed.
  752. '** Arguments:
  753. '**     szDir$  - full directory path (with optional ending "\")
  754. '**     szFile$ - filename to append to directory
  755. '** Returns:
  756. '**     Resulting fully qualified path name.
  757. '*************************************************************************
  758. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  759.     IF szDir$ = "" THEN
  760.     MakePath = szFile$
  761.     ELSEIF szFile$ = "" THEN
  762.     MakePath = szDir$
  763.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  764.     MakePath = szDir$ + szFile$
  765.     ELSE
  766.     MakePath = szDir$ + "\" + szFile$
  767.     END IF
  768. END FUNCTION
  769.  
  770.